<!DOCTYPE html>
<html lang="en">
<head>
    <include file="Common/top"/>
    <include file="Common/import_plugins"/>
</head>
<body class="layui-layout-body">
<include file="Common/nav_menu"/>
<style>
    .func .layui-btn {
        width: 50%;
        float: left;
        padding: 0;
        margin: 0;
    }
</style>
<form action="" class="layui-form" method="post">
    <div id="step1">
        <p>商品名称:{$info.name}</p>

        <input type="hidden" name="sub_orderCode" value="{$sub_order_code}" placeholder="子订单号" class="layui-input">

        <p>单价: <span id="price">{$info.price}</span></p>
        <input type="hidden" name="totalPrice" value="{$info.price}">
        <p>总额: <span id="totalPrice">{$info.price}</span></p>

        <p>数量：<input type="number" name="num" placeholder="数量" class="layui-input" value="1"></p>
        <if condition="$info['is_play_date']">
            <p>游玩时间:
                <input type="text" name="playDate" class="layui-input" placeholder="游玩时间">
            </p>
        </if>
        <p>
            <if condition="$info['is_real']">
                <div class="layui-btn layui-btn-danger layui-btn-block next">下一步</div>
                <else/>
                <input type="submit" class="layui-btn layui-btn-danger layui-btn-block" value="付款">
            </if>
        </p>
        <p>订单金额: <span id="orderPrice"></span></p>
    </div>
    <div id="step2" style="display: none">
        <input type="hidden" name="main_orderCode" value="{$order_code}" placeholder="主订单号" class="layui-input">

        <input type="text" name="certificateNo" placeholder="身份证号" class="layui-input">
        <input type="text" name="linkName" placeholder="联系人" class="layui-input">
        <input type="text" name="linkMobile" placeholder="联系电话" class="layui-input">

        <div class="func">
            <div class="layui-btn layui-btn-normal prev">上一步</div>
            <input type="submit" class="layui-btn layui-btn-danger layui-btn-block" value="付款">
        </div>
    </div>
</form>
<script src="/Public/Home/js/pay_is_real.js"></script>
<script>
    layui.use(['form', 'layedit', 'laydate'], function () {
        var form = layui.form
            , layer = layui.layer
            , layedit = layui.layedit
            , laydate = layui.laydate;

        laydate.render({
            elem: 'input[name=playDate]'
        });
    })
    // 修改金额
    $(function () {
        $('input[name=num]').change(function () {
            var price = $('span#price').html();
            var total_price = Number($(this).val()) * Number(price);
            $('span#totalPrice').html(total_price);
            $('input[name=totalPrice]').val(total_price);
        })
    })
</script>
<script src="/Public/Home/js/common.js"></script>
</body>
</html>